<template>
      <div class="app-body">
            <div class="security-check-container">
                  <h1>环境安全检测</h1>
                  <button @click="checkNetworkSecurity()">开始检测</button>
                  <div class="security-check-result">
                        <p id="security-check-name">{{name}}</p>
                        <p id="security-check-result" v-if="result">{{result}}</p>
                  </div>
            </div>
      </div>
</template>

<script>
export default {
      name: "",
      props: [],
      data() {
            return {
                  url:'',
                  name:'',
                  result:''
            };
      },
      methods: {
            checkNetworkSecurity() {
                  
                  this.name = "检测中...";

                  // 实现网络安全检测的逻辑
                  this.$axios.get(this.$url + "/client/network/env").then(res => {
                        this.name=res.data.data.name;
                        this.result=res.data.data.state;
                  });
            },
      },
};
</script>

<style scoped>
  @import url("https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&display=swap");

  .app-body {
    font-family: "Roboto Mono", monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #1e1e1e;
  }

  .security-check-container {
    background-color: #0f0f0f;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.6);
    width: 350px;
    text-align: center;
  }

  .security-check-container h1 {
    font-size: 32px;
    color: #1e88e5;
    margin-bottom: 20px;
    font-weight: 700;
    text-transform: uppercase;
  }

  .security-check-container input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: none;
    border-radius: 10px;
    background-color: #2b2b2b;
    color: #f5f5f5;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  }

  .security-check-container input:focus {
    outline: none;
  }

  .security-check-container button {
    background-color: #1e88e5;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
    letter-spacing: 2px;
  }

  .security-check-container button:focus {
    outline: none;
  }

  .security-check-result {
    font-size: 18px;
    color: #f5f5f5;
    margin-top: 20px;
    font-weight: 400;
    letter-spacing: 1px
}

.security-check-result span {
font-weight: bold;
color: #1e88e5;
}
</style>
